/*
 * Created on Dec 28, 2003
 */
package org.vectrics.recruiter.struts.admin;

import java.util.Locale;

import javax.servlet.jsp.JspException;

import org.apache.struts.action.ActionErrors;
import org.vectrics.hibernate.ThreadProperties;
import org.vectrics.recruiter.config.RecruitConfig;
import org.vectrics.struts.VectricsActionData;
import org.vectrics.user.Person;
import org.vectrics.user.web.struts.SaveUserAction;
import org.vectrics.user.web.struts.UserProfileForm;

/**
 * @author mmoore
 */
public class SaveAdminPersonAction extends SaveUserAction {

    protected boolean getEmailRequired() {
        return true;
    }

    protected boolean getEmailMustBeUnique() {
        return (RecruitConfig.getRecruitInstance().getEmailMustBeUnique(ThreadProperties.getDomain()));
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.vectrics.user.web.struts.SaveUserAction#getUserNameRequired()
     */
    protected boolean getUserNameRequired() {
        return false;
    }

    protected boolean getGroupsRequired() {
        return (false);
    }

    protected boolean getAuthUserMustBeSavingOwnInfo() {
        return (false);
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.vectrics.user.web.struts.SaveUserAction#getRolesRequired()
     */
    protected boolean getRolesRequired() {
        return true;
    }

    protected boolean getSaveEmails() {
        return (true);
    }

    protected boolean getSavePhoneNumbers() {
        return (true);
    }

    protected boolean getSavePersonName() {
        return (true);
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.vectrics.user.web.struts.SaveUserAction#getSaveHomeAddress()
     */
    protected boolean getSaveHomeAddress() {
        return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.vectrics.user.web.struts.SaveUserAction#getSaveWorkAddress()
     */
    protected boolean getSaveWorkAddress() {
        return false;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.vectrics.user.web.struts.SaveUserAction#getSaveRoles()
     */
    protected boolean getSaveRoles() {
        return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.vectrics.user.web.struts.SaveUserAction#getSavePassword()
     */
    protected boolean getSavePassword(UserProfileForm form) {
        return false;
    }

    protected void saveExtendedData(Person user, VectricsActionData actionData, ActionErrors errors)
            throws JspException {
        //
    }

    protected void onUserAdded(Person userAdded, Person userWhoDidIt, Locale locale) {
    }

    protected void onUserChanged(Person userAdded, Person userWhoDidIt, Locale locale) {
    }

}
